<?php
class Name extends Another Class 
{ 
   Access Variable Declaration 
   Access Function Declaration 
}  
name = $name; 
           $this->password = $password; 
           $this->lastLogin = time(); 
           $this->accesses++; 
       }
       // 获取最后访问的时间 
       function getLastLogin() 
       { 
           return(date("M d Y", $this->lastLogin)); 
       } 
   }
   //创建一个对象的实例 
   $user = new User("Leon", "sdf123");
   //获取最后访问的时间 
   print($user->getLastLogin() ."\n");
   //输出用户名
   print("$user->name\n"); 
?>